package com.ymatou.idcard.api.testcase;

import java.util.Date;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.idcard.api.parameter.UpdateIdCardFromXloboBean;
import com.ymatou.idcard.api.service.UpdateIdCardFromXloboCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;

/**
 * 贝海同步身份证到码头接口 FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_UpdateIdCardFromXlobo {

	private static UpdateIdCardFromXloboBean updateFromXloboBean;
	private static UpdateIdCardFromXloboCall updateFromXloboCall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("贝海同步身份证到码头接口");
	}

	@Before
	public void caseUp() {
		updateFromXloboBean = new UpdateIdCardFromXloboBean();
		updateFromXloboCall = new UpdateIdCardFromXloboCall();

	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(updateFromXloboCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_UpdateIdCardFromXlobo_001() {
		Logger.start(true,"贝海同步身份证到码头成功");
		try {
			updateFromXloboBean.setBuyerId("1111111");
			updateFromXloboBean.setIdCode("1234567894441211");
			updateFromXloboBean.setHasIdPic(1);
			updateFromXloboBean.setName("test_222");
			updateFromXloboBean.setStatus(1);
			updateFromXloboBean.setIdCardType(1);
			updateFromXloboBean.setUploadTime(new Date());
			updateFromXloboBean.setBillCode("11111111");
			updateFromXloboBean.setOperater("auto test fromxlobo");

			updateFromXloboCall.setData(updateFromXloboBean);
			updateFromXloboCall.callService();

			Logger.comment("请求报文:" + updateFromXloboCall.getEntityString());
			Logger.comment("返回报文:" + updateFromXloboCall.getReturnData());
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}